﻿using mds.Queue.MSMQClient;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace mds.Queue
{
    /// <summary>
    /// 消息队列服务消费者接口
    /// </summary>
    public interface IMSMQConsumer
    {
        /// <summary>
        /// 添加到待消费队列
        /// </summary>
        /// <param name="entity"></param>
        /// <param name="exceptionHandler"></param>
        void AddToConsumingQueue(MsmqLogEntity entity, Action<Exception> exceptionHandler = null);
        /// <summary>
        /// 开启消息队列服务
        /// </summary>
        /// <param name="batchCount"></param>
        /// <param name="waitingSec"></param>
        /// <param name="exceptionHandler"></param>
        void StartService(int batchCount, int waitingSec, Action<Exception> exceptionHandler = null);
        /// <summary>
        /// 关闭消息队列服务
        /// </summary>
        void StopService();
    }
}
